package org.saratogaschools.edd.firefighter.client.util;

import org.saratogaschools.edd.firefighter.client.ClientFactory;

import com.google.gwt.core.client.RunAsyncCallback;
import com.google.gwt.place.shared.Place;

public class AsyncPlaceChange implements RunAsyncCallback {
	
	private ClientFactory clientFactory;
	private Place targetPlace;
	
	public AsyncPlaceChange(ClientFactory clientFactory, Place targetPlace) {
		this.clientFactory = clientFactory;
		this.targetPlace = targetPlace;
	}

	@Override
	public void onFailure(Throwable reason) {
	}

	@Override
	public void onSuccess() {
		clientFactory.getPlaceController().goTo(targetPlace);
	}

}
